body {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100vw;
  height: 100vh;
  background: #000;
}
div {
  width: 400px;
  height: 400px;
  position: relative;
  overflow: hidden;
  padding: 15px;
  transform-style: preserve-3d;
  transform: perspective(900px) rotateY(45deg);
  &::after {
    content: '';
    position: absolute;
    display: block;
    width: 100%;
    height: 100%;
    left: 0;
    top: 0;
    z-index: -1;
    transform: scale(3);
    background: linear-gradient(to right, #f1c40f, white, #e67e22, #e74c3c, #9b59b6);
    transition: 2s;
  }
  aside {
    height: 100%;
    overflow: hidden;
    img {
      height: 100%;
    }
  }
  &:hover::after {
    transform: scale(3) rotate(260deg);
  }
}
